package cn.lili.modules.promotion.service;

import cn.lili.common.vo.PageVO;
import cn.lili.modules.promotion.entity.dos.Ticket;
import cn.lili.modules.promotion.entity.dto.search.TicketExportParams;
import cn.lili.modules.promotion.entity.vos.TicketAddVO;
import cn.lili.modules.promotion.entity.vos.TicketBatchDownStateVO;
import cn.lili.modules.promotion.entity.vos.TicketBatchSaleVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface TicketService extends IService<Ticket> {

    /**
     * 分页查询座位
     * @param searchParams
     * @param page
     * @return
     */
    Page<Ticket> getByPage (Ticket searchParams, PageVO page);

    /**
     * 生成座位号
     * @param params
     */
    void generateTicket (TicketAddVO params);

    /**
     * 导出座位
     *
     * @param params
     * @return
     */
    List<Ticket> exportTicket(TicketExportParams params);

    /**
     * 导入门票
     * @param file
     * @throws IOException
     */
    void importTicket (MultipartFile file) throws Exception;

    /**
     * 编辑门票号
     * @param id
     * @param ticketNo
     */
    void updateTicketById (Ticket ticket);

    void updateDownState (String id, Integer state);

    /**
     * 根据画布查询座位
     * @param canvasId
     * @return
     */
    List<Ticket> getByCanvasId (String canvasId);

    /**
     * 删除门票
     * @param id
     */
    void deleteById (String id);

    /**
     * 获取座位号信息
     *
     * @param areaName 区域名称
     * @param areaDirection    区域方向
     * @param line 行
     * @param column 列
     */
    Ticket getTicket(String areaName, String areaDirection, String line, String column);

    /**
     * 根据前端画布大小查询座位
     * @param areaName
     * @param areaDirection
     * @param startNumber
     * @param rowEnd
     * @param columnEnd
     * @return
     */
    List<Ticket> getTicketBySize (String areaName, String areaDirection,
                                  Integer rowStart, Integer columnStart,
                                  Integer rowEnd, Integer columnEnd);

    /**
     * 删除门票
     * @param id
     */
    void delete (String id);

    /**
     * 批量售出座位
     * @param ticketAddVOList
     */
    void batchSale (TicketBatchSaleVO batchSaleVO);

    /**
     * 批量上下架
     * @param batchDownStateVO
     */
    void batchDownState(TicketBatchDownStateVO batchDownStateVO);
}
